package com.zhang.paymentdemo.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhang.paymentdemo.entity.OrderInfo;
import com.zhang.paymentdemo.mapper.OrderInfoMapper;
import com.zhang.paymentdemo.service.OrderInfoService;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {

    @Override
    public int createOrder() {
        OrderInfo orderInfo = new OrderInfo();
        orderInfo.setTitle("vue前端课程精选");
        orderInfo.setOrderNo(UUID.randomUUID().toString());
        orderInfo.setUserId(1003L);
        orderInfo.setProductId(100003L);
        orderInfo.setTotalFee(19);
        orderInfo.setOrderStatus("用户已取消");
        int insert = baseMapper.insert(orderInfo);
        return insert>0?1:-1;
    }
}
